///
/// 字符串帮助类
///
class StringUtils {
  ///
  /// 计算字符串长度
  ///
  static int getLength(String text) {
    if (text == null || text.length == 0) {
      return 0;
    }

    int length = 0;
    for (int i = 0; i < text.length; i++) {
      int intChar = text.codeUnitAt(i);
      length += (intChar > 128 ? 2 : 1);
    }
    return length;
  }

  ///
  /// 判断字符串是否为空
  ///
  static bool isEmpty(String text) {
    return text == null || text.length < 1;
  }

  ///
  /// 判断字符串是否非空
  ///
  static bool isNotEmpty(String text) {
    return !isEmpty(text);
  }
}
